import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description
 * User: cjc
 * Date: 2025-03-08
 * Time: 16:28
 */
public class Test {
    public static void main(String[] args) {
        //test1();
        //test2();
        //test3();
        //test4();
        test5();
    }
    public  static void test1() {
        int[] array = {1,2,3,4,5,6};
        Reverse(array);
        System.out.println(Arrays.toString(array));
    }
    public static void Reverse(int[] array) {
        int left = 0;
        int right = array.length - 1;
        while (left < right) {
            int tmp = array[left];
            array[left] = array[right];
            array[right] = tmp;
            left++;
            right--;
        }
    }
    public static void test2() {
        int[][] array1 = {{1,2,3},{4,5,6,7}};
        int[][] array2 = new int[2][3];//默认初始为0
        int[][] array3 = new int[][]{{1,2,3},{4,5,6}};
        int[][] array4 = new int[2][];
        /*System.out.println(array1.length);
        System.out.println(array1[0]);
        System.out.println(array1[0].length);*/
        for (int[] ints : array1) {
            for (int anInt : ints) {
                System.out.print(anInt + " ");
            }
            System.out.println();
        }
        System.out.println(Arrays.deepToString(array1));
    }
    public static void test3() {
        int[][] array = new int[2][];
        array[0] = new int[]{1,2,3};
        array[1] = new int[]{1,2,3,4,5};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }
    public static void test4() {
        int[] array1 = {1,2,3,4};
        int[] array2 = {1,2,4,3};
        boolean flag = Arrays.equals(array1,array2);
        System.out.println(flag);
    }
    public static void test5() {
        int[] array = new int[10];
        Arrays.fill(array,2,4,1);
        System.out.println(Arrays.toString(array));
        Arrays.fill(array,1);
        System.out.println(Arrays.toString(array));
    }
}
